export default [
  // user
  {
    path: '/user',
    component: '../layouts/UserLayout',
    routes: [
      { path: '/user', redirect: '/user/login' },
      { path: '/user/login', component: './User/Login' },
    ],
  },
  // app
  {
    path: '/',
    component: '../layouts/BasicLayout',
    Routes: ['src/pages/Authorized'],
    authority: ['admin'],
    routes: [
      // 课程
      { path: '/', redirect: '/courses/staffCourses' },
      {
        path: '/courses',
        name: 'courses',
        icon: 'read',
        routes: [
          {
            path: '/courses/staffCourses',
            name: 'staffCourses',
            component: './Courses/staffCourses',
          },
          {
            path: '/courses/dealerCourses',
            name: 'dealerCourses',
            component: './Courses/dealerCourses',
          },
        ],
        authority: ['course'],
      },
      {
        path: '/dealer',
        name: 'dealer',
        icon: 'read',
        routes: [
          {
            path: '/dealer/accounts',
            name: 'accounts',
            component: './Dealer/Accounts/page',
          },
          {
            path: '/dealer/resource',
            name: 'resource',
            component: './Dealer/Resource/page',
          },
          {
            path: '/dealer/carousel',
            name: 'carousel',
            component: './Dealer/Carousel/page',
          },
          {
            path: '/dealer/recommendtrainings',
            name: 'recommendtrainings',
            component: './Dealer/RecommendTraining/page',
          },
        ],
      },
      {
        component: '404',
      },
    ],
  },
];
